#ifndef __tenacitas_crosswords1_concept_layout_tester_h__
#define __tenacitas_crosswords1_concept_layout_tester_h__

#include <iostream>
#include <cstdint>
#include <string>

#include "runtest.h"

#include <tenacitas.crosswords.core/layout.h>
#include <tenacitas.crosswords.core/word.h>
#include <tenacitas.return_code.core/rc.h>

namespace tenacitas {
    namespace crosswords {
        namespace concept {

            class layout_tester {

            private:
                struct supplier {
                    struct organizer {};    
                    typedef std::string text;
                };

                static bool test1() {
                    std::cerr << "\n+++ layout_tester::test1" << std::endl;
                    typedef concept::word<supplier> word;

                    typedef concept::layout<supplier> layout;
                    
                    word _w(typename word::text("sorvete"), 
                            typename word::text("gostoso e gelado"), 
                            word::category::easy);
                    
                    layout _l(0,_w);
                    
                    std::cerr << _l << std::endl;
                    return true;
                }

                static bool test2() {
                    std::cerr << "\n+++ layout_tester::test2" << std::endl;

                    typedef concept::word<supplier> word;
                    typedef concept::layout<supplier> layout;

                    typename word::text _text("sorvete");
                    typename word::text _hint("gostoso e gelado");
                    
                    word _w(_text, _hint, word::category::easy);
                    
                    layout _l1(0,_w);

                    std::cerr << _l1 << std::endl;

                    return (
                        (_l1.get_orientation() == layout::orientation::undef) &&
                        (_l1.get_text() == _text) &&
                        (_l1.get_hint() == _hint) &&
                        (_l1.is_positioned() == false)
                        );
                }

            public:
                static void run() {
                    runtest(layout_tester::test1());
                    runtest(layout_tester::test2());
                }
            };

        }
    }
}

#endif
